<script setup lang="ts">
import { Icons } from "@/constants/images";
import { useExamStore } from "@/store/modules/exam";

const examStore = useExamStore();
defineProps({
  // v-modal
  modelValue: {
    type: Boolean,
    default: false,
  },
});
const emits = defineEmits(["update:modelValue"]);
const close = () => {
  emits("update:modelValue", false);
};
</script>

<template>
  <!-- 
    :class="modelValue ? 'animate__fadeInUp' : 'animate__fadeOutDown'" -->
  <div class="analysis animate__animated" v-show="modelValue">
    <div class="is-flex is-justify-content-space-between is-align-items-center">
      <h5 class="title is-5">答案解析</h5>
      <div class="pointer" @click="close">
        <span class="icon mr-2">
          <img :src="Icons.ICON_LOGIN_CLOSE" />
        </span>
      </div>
    </div>
    <div class="question my-5">
      <div class="is-flex">
        <span class="label">参考答案：</span>
        <span class="black mr-6">{{
          examStore.getCurrentQuestion.answer
        }}</span>
      </div>
      <!-- <p v-html="examStore.getCurrentQuestion['answer']"></p>  -->
    </div>
    <div class="question my-5">
      <p class="label">答案解析：</p>
      <p v-html="examStore.getCurrentQuestion['analysis']"></p>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.analysis {
  position: absolute;
  left: 0;
  bottom: 0;
  background-color: #fff;
  width: 100%;
  height: 500px;
  background: #ffffff;
  box-shadow: 0px 0px 16px 0px rgba(0, 12, 73, 0.15);
  border-radius: 30px;
  padding: 24px 30px;
  .title {
    display: flex;
    align-items: center;
    height: 24px;
    line-height: 1;
    margin-bottom: 0;
    &::before {
      content: "";
      display: inline-block;
      width: 6px;
      height: 14px;
      border-radius: 3px;
      background-color: #00CCCF;
      margin-right: 12px;
      margin-top: 2px;
    }
  }
  .question {
    font-family: Arial, Helvetica, sans-serif;
    .label {
      color: #999;
      font-weight: bold;
    }
    p {
      font-weight: normal;
      // 两端对齐
      // text-align: justify;
    }
  }
}
</style>
